/**
 * Copyright (C) 2013 DaiKit.com - daikit4gxt-sample module (admin@daikit.com)
 *
 *         Project home : http://code.daikit.com/commons
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.daikit.daikit4gxtsample.shared.bean;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.daikit.commons.shared.bean.AbstractDkModifiableAndCleanableBeanWithId;


/**
 * Product Data
 * 
 * @author tcaselli
 * @version $Revision$ Last modifier: $Author$ Last commit: $Date$
 */
public class ProductData extends AbstractDkModifiableAndCleanableBeanWithId
{

	/**
	 * 
	 */
	private static final long serialVersionUID = 6274011186179056222L;
	private String name;
	private String property1;
	private String property2;
	private String property3;
	private String property4;
	private Boolean propertyBoolean;
	private String propertyRichText;
	private Double propertyDouble = Double.valueOf(0);
	private ProductDetailData productDetail;
	private ProductManager productManager;
	private List<SupplierDetailData> supplierDetails = new ArrayList<SupplierDetailData>();
	private Map<LocaleData, String> localizedProperty = new HashMap<LocaleData, String>();
	private List<CountryDetailData> countryDetails = new ArrayList<CountryDetailData>();
	private List<CityData> cities = new ArrayList<CityData>();
	private List<ShopData> shops = new ArrayList<ShopData>();
	private List<String> comments = new ArrayList<String>();

	@Override
	protected StringBuilder getToStringBuilder()
	{
		final StringBuilder stringBuilder = super.getToStringBuilder();
		stringBuilder.append(",name=").append(getName());
		stringBuilder.append(",property1=").append(getProperty1());
		stringBuilder.append(",property2=").append(getProperty2());
		stringBuilder.append(",property3=").append(getProperty3());
		stringBuilder.append(",property4=").append(getProperty4());
		stringBuilder.append(",propertyBoolean=").append(getPropertyBoolean());
		stringBuilder.append(",propertyRichText=").append(getPropertyRichText());
		stringBuilder.append(",propertyDouble=").append(getPropertyDouble());
		stringBuilder.append(",productDetail=").append(getProductDetail());
		stringBuilder.append(",productManager=").append(getProductManager());
		stringBuilder.append(",localizedProperty=").append(getLocalizedProperty());
		stringBuilder.append(",comments=").append(getComments());
		// stringBuilder.append(",supplierDetails=").append(getSupplierDetails());
		return stringBuilder;
	}

	@Override
	protected void cleanDirtyOnChildren()
	{
		for (final SupplierDetailData supplierDetail : supplierDetails)
		{
			supplierDetail.cleanDirty();
		}
	}

	/**
	 * @return the propertyRichText
	 */
	public String getPropertyRichText()
	{
		return propertyRichText;
	}

	/**
	 * @param propertyRichText
	 *           the propertyRichText to set
	 */
	public void setPropertyRichText(final String propertyRichText)
	{
		this.propertyRichText = propertyRichText;
	}

	/**
	 * @return the name
	 */
	public String getName()
	{
		return name;
	}

	/**
	 * @param name
	 *           the name to set
	 */
	public void setName(final String name)
	{
		this.name = name;
	}

	/**
	 * @return the productDetail
	 */
	public ProductDetailData getProductDetail()
	{
		return productDetail;
	}

	/**
	 * @param productDetail
	 *           the productDetail to set
	 */
	public void setProductDetail(final ProductDetailData productDetail)
	{
		this.productDetail = productDetail;
	}

	/**
	 * @return the supplierDetails
	 */
	public List<SupplierDetailData> getSupplierDetails()
	{
		return supplierDetails;
	}

	/**
	 * @param supplierDetails
	 *           the supplierDetails to set
	 */
	public void setSupplierDetails(final List<SupplierDetailData> supplierDetails)
	{
		this.supplierDetails = supplierDetails;
	}

	/**
	 * @return the comments
	 */
	public List<String> getComments()
	{
		return comments;
	}

	/**
	 * @param comments
	 *           the comments to set
	 */
	public void setComments(final List<String> comments)
	{
		this.comments = comments;
	}

	/**
	 * @return the property1
	 */
	public String getProperty1()
	{
		return property1;
	}

	/**
	 * @param property1
	 *           the property1 to set
	 */
	public void setProperty1(final String property1)
	{
		this.property1 = property1;
	}

	/**
	 * @return the property2
	 */
	public String getProperty2()
	{
		return property2;
	}

	/**
	 * @param property2
	 *           the property2 to set
	 */
	public void setProperty2(final String property2)
	{
		this.property2 = property2;
	}

	/**
	 * @return the property3
	 */
	public String getProperty3()
	{
		return property3;
	}

	/**
	 * @param property3
	 *           the property3 to set
	 */
	public void setProperty3(final String property3)
	{
		this.property3 = property3;
	}

	/**
	 * @return the property4
	 */
	public String getProperty4()
	{
		return property4;
	}

	/**
	 * @param property4
	 *           the property4 to set
	 */
	public void setProperty4(final String property4)
	{
		this.property4 = property4;
	}

	/**
	 * @return the productManager
	 */
	public ProductManager getProductManager()
	{
		return productManager;
	}

	/**
	 * @param productManager
	 *           the productManager to set
	 */
	public void setProductManager(final ProductManager productManager)
	{
		this.productManager = productManager;
	}

	/**
	 * @return the localizedProperty
	 */
	public Map<LocaleData, String> getLocalizedProperty()
	{
		return localizedProperty;
	}

	/**
	 * @param localizedProperty
	 *           the localizedProperty to set
	 */
	public void setLocalizedProperty(final Map<LocaleData, String> localizedProperty)
	{
		this.localizedProperty = localizedProperty;
	}

	/**
	 * @return the countryDetails
	 */
	public List<CountryDetailData> getCountryDetails()
	{
		return countryDetails;
	}

	/**
	 * @param countryDetails
	 *           the countryDetails to set
	 */
	public void setCountryDetails(final List<CountryDetailData> countryDetails)
	{
		this.countryDetails = countryDetails;
	}

	/**
	 * @return the cities
	 */
	public List<CityData> getCities()
	{
		return cities;
	}

	/**
	 * @return the shops
	 */
	public List<ShopData> getShops()
	{
		return shops;
	}

	/**
	 * @param cities
	 *           the cities to set
	 */
	public void setCities(final List<CityData> cities)
	{
		this.cities = cities;
	}

	/**
	 * @param shops
	 *           the shops to set
	 */
	public void setShops(final List<ShopData> shops)
	{
		this.shops = shops;
	}

	/**
	 * @return the propertyDouble
	 */
	public Double getPropertyDouble()
	{
		return propertyDouble;
	}

	/**
	 * @param propertyDouble
	 *           the propertyDouble to set
	 */
	public void setPropertyDouble(final Double propertyDouble)
	{
		this.propertyDouble = propertyDouble;
	}

	/**
	 * @return the propertyBoolean
	 */
	public Boolean getPropertyBoolean()
	{
		return propertyBoolean;
	}

	/**
	 * @param propertyBoolean
	 *           the propertyBoolean to set
	 */
	public void setPropertyBoolean(final Boolean propertyBoolean)
	{
		this.propertyBoolean = propertyBoolean;
	}

}
